home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / c / stormamiga_lib-v45_00d / include / sys / dirent.h < prev    next >
C/C++ Source or Header  |  2000-02-28  |  1KB  |  47 lines

  1. #ifndef SYS_DIRENT_H
  2. #define SYS_DIRENT_H
  3.  
  4. /*
  5. **        $VER: sys/dirent.h 1.1 (18.09.98)
  6. **             Includes Release 45.00
  7. **
  8. **    Copyright © 1996/2000 by CyberdyneSystems
  9. **
  10. **            written by Matthias Henze
  11. **               All Rights Reserved
  12. */
  13.  
  14. #ifndef STORMAMIGA_H
  15.   #include <stormamiga.h>
  16. #endif
  17.  
  18. struct dirent {
  19.     uint   d_fileno;                /* file number of entry */
  20.     ushort d_reclen;                /* length of this record */
  21.     uchar  d_type;                  /* file type, see below */
  22.     uchar  d_namlen;                /* length of string in d_name */
  23. #ifdef _POSIX_SOURCE
  24.     char   d_name[255 + 1];         /* name must be no longer than this */
  25. #else
  26. #define MAXNAMLEN       255
  27.     char    d_name[MAXNAMLEN + 1];  /* name must be no longer than this */
  28. #endif
  29. };
  30.  
  31. /* File types */
  32. #define DT_UNKNOWN       0
  33. #define DT_FIFO          1
  34. #define DT_CHR           2
  35. #define DT_DIR           4
  36. #define DT_BLK           6
  37. #define DT_REG           8
  38. #define DT_LNK          10
  39. #define DT_SOCK         12
  40. #define DT_WHT          14
  41.  
  42. /* Convert between stat structure types and directory types. */
  43. #define IFTODT(mode)    (((mode) & 0170000) >> 12)
  44. #define DTTOIF(dirtype) ((dirtype) << 12)
  45.  
  46. #endif  /* SYS_DIRENT_H */
  47.